<h1>Your collections</h1>

<table>
  <tr>
    <th>Title</th>
    <th></th>	
    <th></th>
    <th></th>
  </tr>

<% @user_collections.each do |user_collection| %>
  <tr>
    <td><%= if !Collection.find_by_id(user_collection.collection_id).nil?
    			then Collection.find_by_id(user_collection.collection_id) 
    		else "Destroyed" 
    		end %></td>
    <td><%= link_to 'Show', user_collection %></td>
    <td><%= link_to 'Edit', edit_user_collection_path(user_collection) %></td>
    <td><%= link_to 'Destroy', user_collection, :method => :delete, :data => { :confirm => 'Are you sure?' } %></td>
  </tr>
  <%= link_to "Edit2", edit_user_user_collection_path(User.find_by_id(user_collection.user_id), user_collection) %>
<% end %>
</table>

<br />

<%= link_to 'New User collection', new_user_collection_path %>
